Skip to content

fix(session): merge adjacent reasoning cycles#28012

Open
mturac wants to merge 1 commit into
anomalyco:devfrom
mturac:fix/27987-merge-reasoning-cycles
Open

fix(session): merge adjacent reasoning cycles#28012
mturac wants to merge 1 commit into
anomalyco:devfrom
mturac:fix/27987-merge-reasoning-cycles

Conversation

@mturac
Copy link
Copy Markdown

@mturac mturac commented May 17, 2026

Issue for this PR

Closes #22241
Closes #27987

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adjacent reasoning start/end cycles are now merged into the same reasoning part until a text, tool, or step boundary appears. This keeps providers that stream reasoning one token at a time from rendering many tiny thinking blocks.

How did you verify your code works?

  • bun test test/session/processor-effect.test.ts -t "merge adjacent reasoning cycles" --timeout 30000
  • bun test test/session/processor-effect.test.ts --timeout 30000
  • bun typecheck
  • bunx prettier --check src/session/processor.ts test/session/processor-effect.test.ts
  • git diff --check
  • git push -u mturac fix/27987-merge-reasoning-cycles (pre-push bun turbo typecheck)

Screenshots / recordings

Not applicable; this is a session processor stream handling fix covered by tests.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@mturac mturac force-pushed the fix/27987-merge-reasoning-cycles branch from ad02c5b to d431dac Compare May 17, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant